WT_DECLARE_WT_MEMBER(1,JavaScriptConstructor,"WDialog",function(i,a,g,D,m,n,w,x){function y(){if(w){var b=c.pxself(a,"left"),d=c.pxself(a,"top");if(b!=s||d!=t){s=b;t=d;i.emit(a,w,s,t)}}}function z(b,d){if(!A)if(b!=u||d!=v){u=b;v=d;x&&i.emit(a,x,u,v)}}function E(b){var d=b||window.event;b=c.pageCoordinates(d);d=c.windowCoordinates(d);var e=c.windowSize();if(d.x>0&&d.x<e.x&&d.y>0&&d.y<e.y){m=n=false;if(a.style.right==="auto"||a.style.right===""){a.style.left=c.px(a,"left")+b.x-o+"px";a.style.right=
""}else{a.style.right=c.px(a,"right")+o-b.x+"px";a.style.left="auto"}if(a.style.bottom==="auto"||a.style.bottom===""){a.style.top=c.px(a,"top")+b.y-p+"px";a.style.bottom=""}else{a.style.bottom=c.px(a,"bottom")+p-b.y+"px";a.style.top="auto"}o=b.x;p=b.y}}function F(b,d,e){if(a.style.position=="")a.style.position=c.isIE6?"absolute":"fixed";a.style.visibility="visible";c.windowSize();j=c.parsePct(a.style.height,j);k=c.parsePct(a.style.width,k);a.style.height=Math.max(0,e)+"px";a.style.width=Math.max(0,
d)+"px";z(d,e);h.centerDialog();b=k!=-1;var l=j!=-1;if(b&&l){q=B();r=C();h.onresize(q,r,true)}else if(b){q=B();h.onresize(q,e,true)}else if(l){r=C();h.onresize(d,r,true)}}function B(){return c.windowSize().x*k/100}function C(){return c.windowSize().y*j/100}function G(b,d,e){if(d>0)f.style.width=d+c.parsePx($(f).css("borderLeftWidth"))+c.parsePx($(f).css("borderRightWidth"))+"px";if(e>0)f.style.height=e+c.parsePx($(f).css("borderTopWidth"))+c.parsePx($(f).css("borderBottomWidth"))+"px";h.centerDialog();
a.wtResize&&a.wtResize(a,d,e)}function H(){i.layouts2.adjust()}jQuery.data(a,"obj",this);var h=this,f=$(a).find(".dialog-layout").get(0),c=i.WT,o,p,s=-1,t=-1,u=-1,v=-1,A=false,k=-1,j=-1,q=-1,r=-1;if(g&&D){g.onmousedown=function(b){b=b||window.event;c.capture(g);b=c.pageCoordinates(b);o=b.x;p=b.y;g.onmousemove=E};g.onmouseup=function(){g.onmousemove=null;y();c.capture(null)}}this.centerDialog=function(){var b=c.parsePct(c.css(a,"max-width"),0),d=c.parsePct(c.css(a,"max-height"),0);if(b!==0){var e=
c.windowSize(),l=jQuery.data(f.firstChild,"layout");l&&l.setMaxSize(e.x*b/100,e.y*d/100)}if(a.parentNode==null)a=g=null;else if(a.style.display!="none"&&a.style.visibility!="hidden"){e=c.windowSize();b=a.offsetWidth;d=a.offsetHeight;if(k!=-1)m=true;if(j!=-1)n=true;if(m){a.style.left=Math.round((e.x-b)/2+(c.isIE6?document.documentElement.scrollLeft:0))+"px";a.style.marginLeft="0px"}if(n){a.style.top=Math.round((e.y-d)/2+(c.isIE6?document.documentElement.scrollTop:0))+"px";a.style.marginTop="0px"}if(a.style.position!=
"")a.style.visibility="visible";y()}};this.bringToFront=function(){var b=0;$(".Wt-dialog, .modal, .modal-dialog").each(function(d,e){b=Math.max(b,$(e).css("z-index"))});if(b>a.style.zIndex)a.style.zIndex=b+1};this.onresize=function(b,d,e){m=n=false;A=!e;G(a,b,d);jQuery.data(f.firstChild,"layout").setMaxSize(0,0);i.layouts2.scheduleAdjust();e&&z(b,d)};f.wtResize=F;a.wtPosition=H;if(a.style.width!="")f.style.width=c.parsePx(a.style.width)>0?a.style.width:a.offsetWidth+"px";if(a.style.height!="")f.style.height=
c.parsePx(a.style.height)>0?a.style.height:a.offsetHeight+"px";h.centerDialog()});
